/*
 模板字面量的面量
    -支持换行
    -支持插入变量
    -支持插入数学表达式
    -带标签的模板字符串
    -扩展方法
        -includes  字符中是否包含
        -startWith 字符串以什么开头
        -endWith   字符串以什么结尾
*/
let myname = "caozy";
let str = `sadf asdf ${myname} asdf ${1 + 2} `;
console.log(str);

const names = "caozy";
const gender = true;
function myTagFn(strs, name, gender) {
  console.log(strs, name, gender);
  return strs[0] + name + strs[1] + gender + strs[2];
}
const r = myTagFn`hey, ${names} is a ${gender}`;
console.log(r);
let m = "err: foo is not defined.";
console.log(m.startsWith("err"));
console.log(m.endsWith("."));
console.log(m.includes("foo"));
